# 新增用户 jack
useradd jack
passwd jack

# 安装 unzip
yum -y install unzip

# 安装 dos2unix
yum -y install dos2unix

# 解压
unzip code-help.zip

# 进入脚本目录
cd code-help/bash

# 转一下文件
dos2unix install.sh
dos2unix start_backend.sh
dos2unix start_front.sh
dos2unix stop.sh
dos2unix redis_init.sh
dos2unix nginx_mod.sh
dos2unix nginx_mod_https.sh
dos2unix sync_nginx.sh
dos2unix backup.sh
dos2unix enable_maintenance.sh
dos2unix disable_maintenance.sh

# 设置定时任务
(crontab -l 2>/dev/null | grep -v "backup.sh" || true; echo "0 2 * * * /bin/bash /home/jack/code-help/bash/backup.sh") | crontab -
